#pragma once
#include <Eigen/sparse>
typedef Eigen::SparseMatrix<double> SpMat;

class Struct_Data;

class Struct_Analysis
{
public:
	Struct_Analysis(const Struct_Data& data);
	bool Analyse();
private:
	SpMat m_K11, m_K21, m_K22;
	SpMat m_M11, m_M21, m_M22;
	Eigen::VectorXd x1, x2, F1, F2;

	int m_nFixed;
	int m_nFree;

	const Struct_Data& m_data;

	void AssignDOF();
	void AssembleKs();

	void TreatBoundary();
	void AssembleLoad();
	void solve();
	void Post_Processing();
};

